-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the choice of whether to perform certificate verification when connect to ldaps:// #86
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write some for of test for this?
src/main/java/jenkins/security/plugins/ldap/LDAPConfiguration.java
Outdated
Show resolved
Hide resolved
8ff9c84
to
b43306f
Compare
…nnect to ldaps://
b43306f
to
d5a64d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid force pushing in the future if possible. It makes reviewing harder as I can't see what has changed since I last reviewed.
src/main/java/jenkins/security/plugins/ldap/LDAPConfiguration.java
Outdated
Show resolved
Hide resolved
6c67b86
to
e98596f
Compare
It would also be nice to add some information to the readme about enabling ldaps:// currently even using Google returns 0 results about how to configure it in Jenkins |
It's bad security practice to opt out of certificate validation by default as it opens up for man-in-the-middle attacks. Please leave it on, and allow users to opt out if needed. |
I have modified the default case to need to verify the certificate. Thank you for your advice. |
I would say this is not something that should be added. |
FWIW: you can have a common root cert for these servers and then you can just import that root cert, not all of the certs. |
When connecting to LDAP server over SSL/TLS(LDAPS) with self-signed certificate, the jenkins server cannot connect to LDAP server.
The error log shows that [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target].
If we can get the cert from LDAP server, we import the cert to trust cacerts in jenkins server. Then the above error can be resolved. But if there are multiple servers, this is a bit troublesome.
Another way is to skip certificate validation.
Add the choice "SSL Verify" in LDAP configuarion for users to choose: